// 文件路径: ruoyi-nongjt/src/main/java/com/ruoyi/nongjt/service/impl/NjtCertificateServiceImpl.java
package com.ruoyi.nongjt.service.impl;

import com.ruoyi.nongjt.domain.pojo.NjtCertificate;
import com.ruoyi.nongjt.mapper.NjtCertificateMapper;
import com.ruoyi.nongjt.service.NjtCertificateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NjtCertificateServiceImpl implements NjtCertificateService {

    @Autowired
    private NjtCertificateMapper njtCertificateMapper;

    @Override
    public List<NjtCertificate> getNjtCertificateList(NjtCertificate certificate) {
        return njtCertificateMapper.selectNjtCertificate(certificate);
    }

    @Override
    public NjtCertificate getNjtCertificateById(Long id) {
        return njtCertificateMapper.selectNjtCertificateById(id);
    }

    @Override
    public int insertNjtCertificate(NjtCertificate certificate) {
        return njtCertificateMapper.insertNjtCertificate(certificate);
    }

    @Override
    public int updateNjtCertificate(NjtCertificate certificate) {
        return njtCertificateMapper.updateNjtCertificate(certificate);
    }

    @Override
    public int deleteNjtCertificate(Long id) {
        return njtCertificateMapper.deleteNjtCertificate(id);
    }

    @Override
    public int deleteNjtCertificateBatch(Long[] ids) {
        int total = 0;
        for (Long id : ids) {
            total += njtCertificateMapper.deleteNjtCertificate(id);
        }
        return total;
    }
}
